package io;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class CopyDemo {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("./五黑.png");
        FileOutputStream fos = new FileOutputStream("./五黑1.png");
        /*
            原文件数据：
            11001010 11000110 11001000 11001010
         */
        long start = System.currentTimeMillis();
        while ((fis.read())!=-1){
            fos.write(fis.read());
        }
        long end = System.currentTimeMillis();
        System.out.println("复制完毕！"+(end-start)+"ms");
        fis.close();
        fos.close();
    }

}
